# m = int(input(""))
# n = int(input(""))
# maxNum = 0
# minNum = 0
# if n>=m:
#     maxNum = n
#     minNum = m
# else:
#     maxNum = m
#     minNum = n
# res = maxNum
# while True:
#     if res % maxNum==0 and res %minNum==0:
#         print(res)
#         break
#     else:
#         res = res + 1

'''
辗转相除法
'''

n = int(input("请输入一个整数:"))
m = int(input("请输入一个不相同的整数:"))

beichushu = max(n,m)
chushu = min(n,m)

while True:
    yushu = beichushu % chushu
    if yushu == 0:
        print("最大公约数是",chushu)
        print("最小公倍数是",n*m/chushu)
        break
    else:
        beichushu = chushu
        chushu = yushu